Optimal. Leaf size=401 \[ -\frac {\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right ) \log \left (1-\frac {2 (a+b x) \left (c^2 h-c d g+d^2 f\right )}{(c+d x) \left (-\sqrt {g^2-4 f h} (b c-a d)+2 a c h-a d g-b c g+2 b d f\right )}\right )}{\sqrt {g^2-4 f h}}+\frac {\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right ) \log \left (1-\frac {2 (a+b x) \left (c^2 h-c d g+d^2 f\right )}{(c+d x) \left (\sqrt {g^2-4 f h} (b c-a d)+2 a c h-a d g-b c g+2 b d f\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \text {Li}_2\left (\frac {2 \left (h c^2-d g c+d^2 f\right ) (a+b x)}{\left (-\sqrt {g^2-4 f h} (b c-a d)+2 b d f-b c g-a d g+2 a c h\right ) (c+d x)}\right )}{\sqrt {g^2-4 f h}}+\frac {n \text {Li}_2\left (\frac {2 \left (h c^2-d g c+d^2 f\right ) (a+b x)}{\left (\sqrt {g^2-4 f h} (b c-a d)+2 b d f-b c g-a d g+2 a c h\right ) (c+d x)}\right )}{\sqrt {g^2-4 f h}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.52, antiderivative size = 545, normalized size of antiderivative = 1.36, number of steps used = 19, number of rules used = 7, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.226, Rules used = {2513, 2418, 2394, 2393, 2391, 618, 206} \[ \frac {n \text {PolyLog}\left (2,\frac {2 h (a+b x)}{2 a h-b \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \text {PolyLog}\left (2,\frac {2 h (a+b x)}{2 a h-b \left (\sqrt {g^2-4 f h}+g\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \text {PolyLog}\left (2,\frac {2 h (c+d x)}{2 c h-d \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}+\frac {n \text {PolyLog}\left (2,\frac {2 h (c+d x)}{2 c h-d \left (\sqrt {g^2-4 f h}+g\right )}\right )}{\sqrt {g^2-4 f h}}+\frac {2 \tanh ^{-1}\left (\frac {g+2 h x}{\sqrt {g^2-4 f h}}\right ) \left (-\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+n \log (a+b x)-n \log (c+d x)\right )}{\sqrt {g^2-4 f h}}+\frac {n \log (a+b x) \log \left (-\frac {b \left (-\sqrt {g^2-4 f h}+g+2 h x\right )}{2 a h-b \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \log (a+b x) \log \left (-\frac {b \left (\sqrt {g^2-4 f h}+g+2 h x\right )}{2 a h-b \left (\sqrt {g^2-4 f h}+g\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \log (c+d x) \log \left (-\frac {d \left (-\sqrt {g^2-4 f h}+g+2 h x\right )}{2 c h-d \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}+\frac {n \log (c+d x) \log \left (-\frac {d \left (\sqrt {g^2-4 f h}+g+2 h x\right )}{2 c h-d \left (\sqrt {g^2-4 f h}+g\right )}\right )}{\sqrt {g^2-4 f h}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 618
Rule 2391
Rule 2393
Rule 2394
Rule 2418
Rule 2513
Rubi steps
\begin {align*} \int \frac {\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{f+g x+h x^2} \, dx &=n \int \frac {\log (a+b x)}{f+g x+h x^2} \, dx-n \int \frac {\log (c+d x)}{f+g x+h x^2} \, dx-\left (n \log (a+b x)-\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right ) \int \frac {1}{f+g x+h x^2} \, dx\\ &=n \int \left (\frac {2 h \log (a+b x)}{\sqrt {g^2-4 f h} \left (g-\sqrt {g^2-4 f h}+2 h x\right )}-\frac {2 h \log (a+b x)}{\sqrt {g^2-4 f h} \left (g+\sqrt {g^2-4 f h}+2 h x\right )}\right ) \, dx-n \int \left (\frac {2 h \log (c+d x)}{\sqrt {g^2-4 f h} \left (g-\sqrt {g^2-4 f h}+2 h x\right )}-\frac {2 h \log (c+d x)}{\sqrt {g^2-4 f h} \left (g+\sqrt {g^2-4 f h}+2 h x\right )}\right ) \, dx-\left (2 \left (-n \log (a+b x)+\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+n \log (c+d x)\right )\right ) \operatorname {Subst}\left (\int \frac {1}{g^2-4 f h-x^2} \, dx,x,g+2 h x\right )\\ &=\frac {2 \tanh ^{-1}\left (\frac {g+2 h x}{\sqrt {g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{\sqrt {g^2-4 f h}}+\frac {(2 h n) \int \frac {\log (a+b x)}{g-\sqrt {g^2-4 f h}+2 h x} \, dx}{\sqrt {g^2-4 f h}}-\frac {(2 h n) \int \frac {\log (a+b x)}{g+\sqrt {g^2-4 f h}+2 h x} \, dx}{\sqrt {g^2-4 f h}}-\frac {(2 h n) \int \frac {\log (c+d x)}{g-\sqrt {g^2-4 f h}+2 h x} \, dx}{\sqrt {g^2-4 f h}}+\frac {(2 h n) \int \frac {\log (c+d x)}{g+\sqrt {g^2-4 f h}+2 h x} \, dx}{\sqrt {g^2-4 f h}}\\ &=\frac {2 \tanh ^{-1}\left (\frac {g+2 h x}{\sqrt {g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{\sqrt {g^2-4 f h}}+\frac {n \log (a+b x) \log \left (-\frac {b \left (g-\sqrt {g^2-4 f h}+2 h x\right )}{2 a h-b \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \log (c+d x) \log \left (-\frac {d \left (g-\sqrt {g^2-4 f h}+2 h x\right )}{2 c h-d \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \log (a+b x) \log \left (-\frac {b \left (g+\sqrt {g^2-4 f h}+2 h x\right )}{2 a h-b \left (g+\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}+\frac {n \log (c+d x) \log \left (-\frac {d \left (g+\sqrt {g^2-4 f h}+2 h x\right )}{2 c h-d \left (g+\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {(b n) \int \frac {\log \left (\frac {b \left (g-\sqrt {g^2-4 f h}+2 h x\right )}{-2 a h+b \left (g-\sqrt {g^2-4 f h}\right )}\right )}{a+b x} \, dx}{\sqrt {g^2-4 f h}}+\frac {(b n) \int \frac {\log \left (\frac {b \left (g+\sqrt {g^2-4 f h}+2 h x\right )}{-2 a h+b \left (g+\sqrt {g^2-4 f h}\right )}\right )}{a+b x} \, dx}{\sqrt {g^2-4 f h}}+\frac {(d n) \int \frac {\log \left (\frac {d \left (g-\sqrt {g^2-4 f h}+2 h x\right )}{-2 c h+d \left (g-\sqrt {g^2-4 f h}\right )}\right )}{c+d x} \, dx}{\sqrt {g^2-4 f h}}-\frac {(d n) \int \frac {\log \left (\frac {d \left (g+\sqrt {g^2-4 f h}+2 h x\right )}{-2 c h+d \left (g+\sqrt {g^2-4 f h}\right )}\right )}{c+d x} \, dx}{\sqrt {g^2-4 f h}}\\ &=\frac {2 \tanh ^{-1}\left (\frac {g+2 h x}{\sqrt {g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{\sqrt {g^2-4 f h}}+\frac {n \log (a+b x) \log \left (-\frac {b \left (g-\sqrt {g^2-4 f h}+2 h x\right )}{2 a h-b \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \log (c+d x) \log \left (-\frac {d \left (g-\sqrt {g^2-4 f h}+2 h x\right )}{2 c h-d \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \log (a+b x) \log \left (-\frac {b \left (g+\sqrt {g^2-4 f h}+2 h x\right )}{2 a h-b \left (g+\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}+\frac {n \log (c+d x) \log \left (-\frac {d \left (g+\sqrt {g^2-4 f h}+2 h x\right )}{2 c h-d \left (g+\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \operatorname {Subst}\left (\int \frac {\log \left (1+\frac {2 h x}{-2 a h+b \left (g-\sqrt {g^2-4 f h}\right )}\right )}{x} \, dx,x,a+b x\right )}{\sqrt {g^2-4 f h}}+\frac {n \operatorname {Subst}\left (\int \frac {\log \left (1+\frac {2 h x}{-2 c h+d \left (g-\sqrt {g^2-4 f h}\right )}\right )}{x} \, dx,x,c+d x\right )}{\sqrt {g^2-4 f h}}+\frac {n \operatorname {Subst}\left (\int \frac {\log \left (1+\frac {2 h x}{-2 a h+b \left (g+\sqrt {g^2-4 f h}\right )}\right )}{x} \, dx,x,a+b x\right )}{\sqrt {g^2-4 f h}}-\frac {n \operatorname {Subst}\left (\int \frac {\log \left (1+\frac {2 h x}{-2 c h+d \left (g+\sqrt {g^2-4 f h}\right )}\right )}{x} \, dx,x,c+d x\right )}{\sqrt {g^2-4 f h}}\\ &=\frac {2 \tanh ^{-1}\left (\frac {g+2 h x}{\sqrt {g^2-4 f h}}\right ) \left (n \log (a+b x)-\log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )-n \log (c+d x)\right )}{\sqrt {g^2-4 f h}}+\frac {n \log (a+b x) \log \left (-\frac {b \left (g-\sqrt {g^2-4 f h}+2 h x\right )}{2 a h-b \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \log (c+d x) \log \left (-\frac {d \left (g-\sqrt {g^2-4 f h}+2 h x\right )}{2 c h-d \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \log (a+b x) \log \left (-\frac {b \left (g+\sqrt {g^2-4 f h}+2 h x\right )}{2 a h-b \left (g+\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}+\frac {n \log (c+d x) \log \left (-\frac {d \left (g+\sqrt {g^2-4 f h}+2 h x\right )}{2 c h-d \left (g+\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}+\frac {n \text {Li}_2\left (\frac {2 h (a+b x)}{2 a h-b \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \text {Li}_2\left (\frac {2 h (a+b x)}{2 a h-b \left (g+\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}-\frac {n \text {Li}_2\left (\frac {2 h (c+d x)}{2 c h-d \left (g-\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}+\frac {n \text {Li}_2\left (\frac {2 h (c+d x)}{2 c h-d \left (g+\sqrt {g^2-4 f h}\right )}\right )}{\sqrt {g^2-4 f h}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.35, size = 515, normalized size = 1.28 \[ \frac {\log \left (-\sqrt {g^2-4 f h}+g+2 h x\right ) \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )-\log \left (\sqrt {g^2-4 f h}+g+2 h x\right ) \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )-n \text {Li}_2\left (\frac {b \left (-g-2 h x+\sqrt {g^2-4 f h}\right )}{2 a h+b \left (\sqrt {g^2-4 f h}-g\right )}\right )+n \text {Li}_2\left (\frac {b \left (g+2 h x+\sqrt {g^2-4 f h}\right )}{b \left (g+\sqrt {g^2-4 f h}\right )-2 a h}\right )-n \log \left (-\sqrt {g^2-4 f h}+g+2 h x\right ) \log \left (\frac {2 h (a+b x)}{2 a h+b \sqrt {g^2-4 f h}+b (-g)}\right )+n \log \left (\sqrt {g^2-4 f h}+g+2 h x\right ) \log \left (\frac {2 h (a+b x)}{2 a h-b \left (\sqrt {g^2-4 f h}+g\right )}\right )+n \text {Li}_2\left (\frac {d \left (-g-2 h x+\sqrt {g^2-4 f h}\right )}{-g d+\sqrt {g^2-4 f h} d+2 c h}\right )-n \text {Li}_2\left (\frac {d \left (g+2 h x+\sqrt {g^2-4 f h}\right )}{d \left (g+\sqrt {g^2-4 f h}\right )-2 c h}\right )+n \log \left (-\sqrt {g^2-4 f h}+g+2 h x\right ) \log \left (\frac {2 h (c+d x)}{2 c h+d \sqrt {g^2-4 f h}+d (-g)}\right )-n \log \left (\sqrt {g^2-4 f h}+g+2 h x\right ) \log \left (\frac {2 h (c+d x)}{2 c h-d \left (\sqrt {g^2-4 f h}+g\right )}\right )}{\sqrt {g^2-4 f h}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 1.47, size = 0, normalized size = 0.00 \[ {\rm integral}\left (\frac {\log \left (e \left (\frac {b x + a}{d x + c}\right )^{n}\right )}{h x^{2} + g x + f}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 0.86, size = 0, normalized size = 0.00 \[ \int \frac {\ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )}{h \,x^{2}+g x +f}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int \frac {\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )}{h\,x^2+g\,x+f} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________